// 用户地址模型
const { Address, validateAddress } = require('../../../models/address');
// 统一数据返回类
const { DataReturn } = require('../../../common/returnclass');

module.exports = async (req, res) => {
	console.log(req.fields);
	// 创建地址对象
	let address = new Address(req.fields);
	// 保存商品信息
	address.save()
	.then(()=>{
		DataReturn.getData(res,200,[],'添加地址成功')
	}).catch(()=>{
		DataReturn.getData(res,400,[],'添加地址失败')
	})

}
